<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>超级管理员</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
        }

        h1 {
            text-align: center;
            font-size: 24px;
            margin-bottom: 20px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }

        th, td {
            padding: 10px;
            text-align: left;
        }

        th {
            background-color: #f1f1f1;
        }

        tr:nth-child(even) {
            background-color: #f9f9f9;
        }

        a {
            text-decoration: none;
            color: #0066cc;
        }

        a:hover {
            text-decoration: underline;
        }
    </style>
</head>

<body>
    <div class="container">
        <h1>管理界面</h1>
        <hr>
        
        <table border="1">
            <tr>
                <th>卡号</th>
                <th>余额</th>
                <th>操作</th>
            </tr>
            {% for user in users %} 
            <tr>
                <td>{{ user.card_id }}</td>
                <td>{{ user.data }}</td>
                <td>
                    <a href="/charge/{{user.card_id}}">充值</a>
                    <a href="/delete/?uid={{user.card_id}}">删除</a>
                </td>
            </tr>
            {% endfor %}
        </table>
        <br>
        <table border="1">
            <tr>
                <th>编号</th>
                <th>商品</th>
                <th>价格</th>
                <th>余量</th>
                <th>操作</th>
            </tr>
            {% for good in goods %} 
            <tr>
                <td>{{ good.id }}</td>
                <td>{{ good.goods_name }}</td>
                <td>{{ good.price }}</td>
                <td>{{ good.amount }}</td>
                <td>
                    <a href="/add/?id={{good.id}}">补货</a>
                </td>
            </tr>
            {% endfor %}
        </table>
    </div>
</body>

</html>